﻿//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1998-2024 Glodon Company Limited.
//
// Licensed under the MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the “Software”),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////////
#pragma  once
#include "IDocument.h"
#include "IDockablePickFilterWidget.h"
#include "GcmpBuiltInCategoryUniIdentities.h"
#include "GbmpBuiltInCategoryUniIdentitiesNew.h"

namespace gcmp
{
    //显示过滤与拾取过滤面板中的categories相同,将初始化类别这部分拿出来共同使用
    class GbmpPickFilterWidgetInitalizer : public IPickFilterWidgetInitializer
    {
    public:
        virtual std::vector<UniIdentity> GetCategories(const IDocument* pDocument) const override
        {
            std::vector<UniIdentity> categories;
            DBG_WARN_AND_RETURN_UNLESS(pDocument, categories, L"pDocument指针为空，不合法",L"GDMPLab",L"2024-03-30");

            if (pDocument->IsFamilyDocument())
            {
                categories.push_back(BuiltInCategoryUniIdentities::BICU_POINT_FAMILY);//点式族
                categories.push_back(BuiltInCategoryUniIdentities::BICU_LINE_FAMILY);//线式族
                //categories.push_back(BuiltInCategoryUniIdentities::BICU_NEW_ELEVATION);//新标高,族编辑器环境中不再创建使用标高
                categories.push_back(BuiltInCategoryUniIdentities::BICU_REFERENCE_PLANE);//参照平面
                categories.push_back(BuiltInCategoryUniIdentities::BICU_REFERENCE_LINE);//参照线 
                categories.push_back(BuiltInCategoryUniIdentities::BICU_SKETCH_LINE);//草图线
                categories.push_back(BuiltInCategoryUniIdentities::BICU_MODEL_LINE);//模型线
                categories.push_back(BuiltInCategoryUniIdentities::BICU_DRAWING_LINE);//二维线
                categories.push_back(BuiltInCategoryUniIdentities::BICU_DIMENSION_TEXT);//尺寸标注--文字
                categories.push_back(BuiltInCategoryUniIdentities::BICU_VIEW_SYMBOL);//视图符号
                categories.push_back(BuiltInCategoryUniIdentities::BICU_FAM_CONSTRAINT);//尺寸标注(族中定义的约束：尺寸标注和几何约束的统一设置为约束)
                categories.push_back(BuiltInCategoryUniIdentities::BICU_SKETCH_LOCATION_LINE);//草图上的定位线
                categories.push_back(BuiltInCategoryUniIdentities::BICU_MEPCONNECTOR);//机电连接件
            }
            else
            {
                categories.push_back(BuiltInCategoryUniIdentities::BICU_STRUCTURE_WALL);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_STRUCTURE_COLUMN);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_STRUCTURE_BEAM);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_STRUCTURE_FLOOR);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_NEW_STAIR);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_STRUCTURE_WALL_HOLE);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_STRUCTURE_PLATE_HOLE);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_NEW_ROOF);
                // 照明设备
                // 家具
                // 卫浴装置
                categories.push_back(BuiltInCategoryUniIdentities::BICU_NEW_HANDRAIL);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_POINT_FAMILY);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_LINE_FAMILY);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_NEW_ELEVATION);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_REFERENCE_PLANE);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_NEW_GRID);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_MODEL_LINE);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_VIEW_SYMBOL);
                categories.push_back(BuiltInCategoryUniIdentities::BICU_DIMENSION_TEXT);
            }
            return categories;
        }
    };
}
